package com.service.user.imp;

import java.util.List;

import org.apache.log4j.Logger;

import com.AContext;
import com.bo.Wanted;
import com.manager.wanted.IWantedManager;
import com.service.people.imp.PeopleService;
import com.service.wanted.IWantedService;

public class WantedService implements IWantedService {

	private static final Logger LOG = Logger.getLogger(PeopleService.class);

	private AContext context;
	
	private IWantedManager wantedManager;
	
	public WantedService(AContext context){
		this.context = context;
	}
	public void start() {
		this.wantedManager = context.getWantedManager();	
	}

	public void stop() {
		LOG.info("people service is stopped !");
	}
	
	@Override
	public void saveWanted(Wanted wanted) {
		if(wanted == null){
			return;
		}
		wantedManager.saveWanted(wanted);
	}

	@Override
	public void updateWanted(Wanted wanted) {
		if(wanted == null){
			return;
		}
		wantedManager.updateWanted(wanted);
	}

	@Override
	public void deleteWanted(String id) {
		Wanted wanted = wantedManager.getWantedById(id);
		wantedManager.deleteWanted(wanted);
	}

	@Override
	public Wanted getWantedById(String id) {
		return wantedManager.getWantedById(id);
	}

	@Override
	public List<Wanted> getWantedList() {
		return wantedManager.getWantedList();
	}

}
